package models

import "time"

type User struct {
	UId      int       `gorm:"primaryKey"`
	Username string    `gorm:"column:username;comment:'用户名'" validate:"min=4,max=20,regexp=^[a-zA-Z0-9_]*$"`
	Passcode string    `gorm:"column:passcode;comment:'加密随机数'"`
	Passwd   string    `gorm:"column:passwd;comment:'md5密码'"`
	Hardware string    `gorm:"column:hardware;comment:'hardware'"`
	Status   int       `gorm:"column:status;comment:'用户账号状态。0-默认；1-冻结；2-停号'"`
	Ctime    time.Time `gorm:"column:ctime"`
	Mtime    time.Time `gorm:"column:mtime"`
	IsOnline bool      `gorm:"-"`
}

//gorm 自行指定表名

func (*User) TableName() string {
	return "user"
}
